import request from "@/utils/request";

const MerchantAPI = {
  /** 新增商户信息*/
  add(data: any) {
    return request({
      url: `/admin/tenant/add`,
      method: "post",
      data,
      headers: {
        "Content-Type": "application/json",
      },
    });
  },
  /** 商户列表*/
  list(data: any) {
    return request({
      url: "/admin/tenant/page",
      method: "post",
      data,
      headers: {
        "Content-Type": "application/json",
      },
    });
  },
  /** 删除商户信息*/
  delMerchant(id: any) {
    return request({
      url: `/admin/tenant/delete/${id}`,
      method: "DELETE",
      headers: {
        "Content-Type": "application/json",
      },
    });
  },
  /** 回显商户信息*/
  detail(id: any) {
    return request({
      url: `/admin/tenant/page/${id}`,
      method: "get",
    });
  },
  /** 修改商户信息*/
  update(data: any) {
    return request({
      url: "/admin/tenant/update",
      method: "POST",
      data,
      headers: {
        "Content-Type": "application/json",
      },
    });
  },
  /** 修改商户状态*/
  changeStatus(data: any) {
    return request({
      url: "/admin/tenant/status",
      method: "POST",
      data,
      headers: {
        "Content-Type": "application/json",
      },
    });
  },
  /** 获取水库下拉列表*/
  opsList(data: any) {
    return request({
      url: "/admin/tenant/reservoir",
      method: "POST",
      data,
      headers: {
        "Content-Type": "application/json",
      },
    });
  },
};

export default MerchantAPI;
